package com.dreamcar.auction.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Supplier entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "supplier", catalog = "assignment")
public class Supplier implements java.io.Serializable {

	// Fields

	private Integer idSupplier;
	private String username;
	private String password;
	private String name;
	private String email;
	private Set<Bid> bids = new HashSet<Bid>(0);

	// Constructors

	/** default constructor */
	public Supplier() {
	}

	/** minimal constructor */
	public Supplier(Integer idSupplier) {
		this.idSupplier = idSupplier;
	}

	/** full constructor */
	public Supplier(Integer idSupplier, String username, String password,
			String name, String email, Set<Bid> bids) {
		this.idSupplier = idSupplier;
		this.username = username;
		this.password = password;
		this.name = name;
		this.email = email;
		this.bids = bids;
	}

	// Property accessors
	@Id
	@Column(name = "ID_SUPPLIER", unique = true, nullable = false)
	public Integer getIdSupplier() {
		return this.idSupplier;
	}

	public void setIdSupplier(Integer idSupplier) {
		this.idSupplier = idSupplier;
	}

	@Column(name = "USERNAME", length = 45)
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "PASSWORD", length = 45)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "NAME", length = 45)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "EMAIL", length = 40)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "supplier")
	public Set<Bid> getBids() {
		return this.bids;
	}

	public void setBids(Set<Bid> bids) {
		this.bids = bids;
	}

}